<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		
		<div>
			<input type="checkbox" name="n">篮球<br />
			<input type="checkbox" name="n">唱<br />
			<input type="checkbox" name="n">跳<br />
			<input type="checkbox" name="n">rap<br />
			<input type="checkbox" name="n">时长两年半
		</div>
        <script type="text/javascript" >
          let arrDiv=document.getElementsByName('n')
         console.log(arrDiv)
          for(i=0;i<arrDiv.length;i++){
            let objDiv=arrDiv[i];
            objDiv.checked=true;
          }
            </script>
	</body>
</html>
